package com.example.spingbootvue.service;

import com.example.spingbootvue.entity.employeemessage;
import com.example.spingbootvue.mapper.employeemessageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class handinresumeservice {
    @Autowired
    employeemessageMapper employeemessageMapper;

    //判断传入的applicantaccount是否在数据库与对应的id重复了
    public int ifresume(employeemessage employeemessage,Integer id,String applicantaccount,String applicant,String educational){

        employeemessage ts=employeemessageMapper.findById(id,applicantaccount);

        if(ts!=null){
            return 0;
        }else {
            employeemessageMapper.insertbyaccount(employeemessage.getFirmname(),employeemessage.getPosition(),employeemessage.getWage(),employeemessage.getContacts(),employeemessage.getPhone(),employeemessage.getFirmaddress(),applicantaccount,applicant,id,employeemessage.getAccount(),educational);
            return 1;
        }
    }

}
